<?php 
function set_activiteiten_tabel($result, $eerstVolgendeActiviteit, $li_class=null, $first_li=null, $aanwezigheidZichtbaar=null, $info_weergeven=null) {
	/*
	 * De tabel wordt aangemaakt
	 */
	//$color = true;
	//echo "<div class='list'>";
	echo "<table class='table_list' cellspacing='0'>";
	/*
	echo "<table class='met_border agenda_tabel'>";
		echo "<tr class='normaal".($color ? "" : " alternate")."'>";	
			if(isset($selecteren)) {			echo "<th class='col_selecteren'>&nbsp;</th>";}
			if(isset($wijzigen)) {				echo "<th class='col_wijzigen'>&nbsp;</th>";}
			if(isset($verwijderen)) {			echo "<th class='col_verwijderen'>&nbsp;</th>";}
			if(isset($aanwezigheidZichtbaar)) {	echo "<th class='col_aanwezigheid'>&nbsp;</th>";}
			if(isset($aanwezigheidSelecteren)) {echo "<th class='col_aanwezigheid_selecteren'>&nbsp;</th>";}
			echo "<th class='col_dag'>Dag</th>
				<th class='col_datum'>Datum</th>
				<th class='col_tijd'>Tijd</th>
				<th class='col_training_icon'>&nbsp;</th>
				<th class='col_activiteit'>Activitet</th>";
			if(isset($bbcode)) {	echo "<th class='col_info' colspan='2'>Info</th>";}
			else {					echo "<th class='col_aflasting'>Info</th>";}
		echo "</tr>";
		*/
	$color = false;
	$eerste_rij_geplaatst = false;
	if(isset($first_li)) {
		echo $first_li;
		$eerste_rij_geplaatst = true;
	}
	while($row = mysql_fetch_array($result)) {
		if($eerste_rij_geplaatst) {
			//echo "<li class='empty_list'></li>";
		}
		$eerste_rij_geplaatst = true;
		echo "<tr".($eerstVolgendeActiviteit == $row['agendaId'] ? " class='selected'" : ($color ? " class='alternate'" : "")).">";
		//echo "<div class='agenda_post".($row['soort'] == 1 ? " training" : " overig").(isset($row['bericht']) ? " tooltip" : "")."' rel='".$row['bericht']."'>";
		//($color ? $color = false: $color = true);
		//echo "<tr class='normaal".($eerstVolgendeActiviteit == $row['agendaId'] ? " selected" : ($color ? "" : " alternate"))."'>";
		/*
		if(isset($aanwezigheidZichtbaar)) {
			if(empty($row['afmelden'])) {		echo "<tr class='streepje".($eerstVolgendeActiviteit == $row['agendaId'] ? " selected" : "").(isset($li_class) ? " ".$li_class : "")."'>";}
			else if($row['afmelden'] == 1) {	echo "<tr class='".(empty($row['afwezig']) || $row['afwezig'] == '1' ? "aanwezig" : ($row['afwezig'] == '2' ? "onbekend" : "afwezig"))."'>";}
			else if($row['afmelden'] == 2) {	echo "<tr class='".(empty($row['afwezig']) || $row['afwezig'] == '3' || $row['afwezig'] == '4' ? "afwezig" : ($row['afwezig'] == '2' ? "onbekend" : "aanwezig"))."'>";}
		}else {
			echo "<li class='multiline".($eerstVolgendeActiviteit == $row['agendaId'] ? " selected" : "").(isset($li_class) ? " ".$li_class : "")."'>";
		}
			*/
			//Afgelasting
			//if($row['afgelast'] == '1') {
				//echo "<small>Afgelast</small>";
			//}
			
		
			//Datum en tijd
			echo "<td style='width: 23%; padding-left: 5px; background-color: #f9d3a8; border-top-color: #fce7cf; border-bottom-color: #f7c082;'><a style='line-height: 20px; font-size: 0.8em; color: #333;' class='smaller' href='/extra/agenda/nmr2/agendaInfo.php?agendaId=".$row['agendaId']."'>".getDagWeekString(date('w', strtotime($row['datum'])), true).". ".date('j', strtotime($row['datum']))." ".getMaandString(date('m', strtotime($row['datum'])), true)."<br>".date('H:i', strtotime($row['datum']))."</a></td>";	
		
			echo "<td style='width: 57%; padding-left: 5px;'><a class='smaller' href='/extra/agenda/nmr2/agendaInfo.php?agendaId=".$row['agendaId']."'>".$row['gebeurtenis']."</a></td>";
			echo "<td style='width: 20%;'><div class='".($row['afgelast'] == '1' ? "cancel_icon" : "ok_icon")." accent'></div>&nbsp;&nbsp;&nbsp;<div class='arrow'></div></td>";
    		//echo "<td style='width: 40%'><a class='smaller' href='/extra/agenda/nmr2/agendaInfo.php?agendaId=".$row['agendaId']."'>".date('j', strtotime($row['datum']))." ".getMaandString(date('m', strtotime($row['datum'])), true).", ".date('H:i', strtotime($row['datum']))."</a></td>";
    	echo "</tr>";
    	if(isset($info_weergeven) && isset($row['bericht'])) {
    		echo "<tr".($eerstVolgendeActiviteit == $row['agendaId'] ? " class='selected'" : ($color ? " class='alternate'" : "")).">";
    			echo "<td class='opmerking' colspan='2'><a class='smaller' href='/extra/agenda/nmr2/agendaInfo.php?agendaId=".$row['agendaId']."'>".$row['bericht']."</a></td>";
    		echo "<tr>";
    	}
    	
		if($eerstVolgendeActiviteit <> $row['agendaId']) {
			$color ? $color = false : $color = true;
		}
	}
	echo "</table>";
	//echo "</div>";
}